package com.mrjy.common.qtz;

import com.mrjy.common.entity.UserVideoRel;
import com.mrjy.video.dao.IUserVideoRelDao;
import org.apache.log4j.Logger;

import javax.annotation.Resource;

/**
 * 清空 学习记录数值
 *
 * @author csshui
 * @date 2017-12-18
 */
public class DailyStudyTruncateJob {

    @Resource
    private IUserVideoRelDao userVideoRelDao;

    private static Logger logger = Logger.getLogger(DailyStudyTruncateJob.class);

    /**
     * @param
     * @Description: 任务执行获取 token
     */
    @SuppressWarnings("unchecked")
    public void doJob() {
        logger.debug(" 清空 学习记录数值 ：=================================>");
        UserVideoRel userVideoRel = new UserVideoRel();
        userVideoRel.setAccumulativeDaily(0);
        int result = userVideoRelDao.updateDailyStudyTruncate(userVideoRel);
        if (result > 0) {
            logger.debug(" 清空 学习记录数值 ：=================================> 成功");
        } else {
            logger.debug(" 清空 学习记录数值 ：=================================> 失败");
        }
    }

}